﻿module ActiveRecordExtensions

open Castle.ActiveRecord
open Castle.ActiveRecord.Framework
open Castle.ActiveRecord.Framework.Internal

let modelCreated = new Event<ActiveRecordModel * IConfigurationSource>()

let subscribeToModelCreated (model: ActiveRecordModel) (config: IConfigurationSource) =
    modelCreated.Trigger(model,config)

ActiveRecordStarter.add_ModelCreated (ModelDelegate(subscribeToModelCreated))

type ActiveRecordStarter with
    static member FModelCreated = modelCreated.Publish